home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / Development / PowerD / alpha / examples / unique.d < prev    next >
Encoding:
Text File  |  2002-10-28  |  370 b   |  21 lines

  1. /* A demo to show how to get a really unique number */
  2.  
  3. BYTE '\0$VER:unique V0.1 by DMX (\x5d)\0'
  4.  
  5. MODULE 'utility'
  6.  
  7. OPT DOSONLY
  8.  
  9. DEF UtilityBase
  10.  
  11. PROC main()
  12.  
  13.   UtilityBase:=OpenLibrary('utility.library', 0)
  14.   IF UtilityBase
  15.   DEF get=NIL:UL
  16.   get:=GetUniqueID()
  17.   PrintF('get = \d, random = \d\n',get, Rnd(Abs(ULong(get))))
  18.   CloseLibrary(UtilityBase)
  19.   ENDIF
  20. ENDPROC
  21.